package org.nowcoder.leetcode.BSearch;

import java.util.Arrays;

/**
 * Title  : 704. Binary Search
 * Source : https://leetcode.cn/problems/binary-search/description/
 * Author : XrazYang
 * Date   : 2023-10-24
 */

public class LeetCode_704 {
    public int search(int[] nums, int target) {
        int index = Arrays.binarySearch(nums, target);
        return index >= 0 ? index : -1;
    }
}
